servlet: set description for CANCELLED status#11927
Merged
shivaspeaks merged 2 commits intogrpc:masterfrom Mar 12, 2025
Merged
Conversation
shivaspeaks
approved these changes
Mar 2, 2025
kannanjgithub
requested changes
Mar 11, 2025
| transportState.runOnTransportThread(() -> transportState.transportReportStatus(status)); | ||
| // There is no way to RST_STREAM with CANCEL code, so write trailers instead | ||
| close(Status.CANCELLED.withCause(status.asRuntimeException()), new Metadata()); | ||
| close(Status.CANCELLED.withDescription("servlet io exception") |
Contributor
There was a problem hiding this comment.
The description doesn't seem right - we can't assume it was an IO exception, and there may be other causes on non-Tomcat containers. Can we just say "Stream cancelled"?
Contributor
Author
There was a problem hiding this comment.
If this is received by client - I want to be able to find the source of that in code, otherwise it's quite confusing.
As logic here is a bit special for servlets, I would keep the "servlet" word.
so, can we agree on "servlet stream cancelled" ?
Contributor
There was a problem hiding this comment.
Yes, but lets capitalize the first letter. Other places setting description in status do so.
kannanjgithub
approved these changes
Mar 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It eventually happens from Tomcat when it's behind nginx.
Currently caller gets just
io.grpc.StatusRuntimeException: CANCELLEDwhich is not very clear.I guess when this code was originally developed, the assumption was that nobody will received it, but it actually happens, so worth making this status more clear.
if you are curious, the exception which causes that is